import axios from 'axios';
import unit from '../../unit';

const domainName = 'http://localhost';
const port = 3002;
const host = domainName+':'+port;
const Encode = unit.Encode;

export interface IGetArticleAll {
  author:string
  anthology:string
}

export interface IGetArticle{
  id:number
}

export interface IGetArticleContent {
  id:string
}

export default {
  post:{
    getAnthology:(data={})=>axios.post(host+'/get/anthology',Encode.encode(data)),
    getArticle:(data:IGetArticle)=>axios.post(host+'/get/article/content',Encode.encode(data)),
    getArticleAll:(data:IGetArticleAll)=>axios.post(host+'/get/articleAll',Encode.encode(data)),
  },
  get:{
    getArticleContent:(data:IGetArticleContent)=>axios.get(host+'/get/article/'+data.id),
  }
};
